package com.store.business;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class CompanyInDatabase {
	
	private int idCompany;
    private String nameCompany;
    private String descriptionCompany;
    private String secteurActiviteCompany;
    private int numberContratsCompany;
    List<ProductInStock> products  = new ArrayList<ProductInStock>();

    
    


	public CompanyInDatabase() {
    }
    
	
        public CompanyInDatabase(String name, String description) {
		this.nameCompany = name;
		this.descriptionCompany= description;
		this.numberContratsCompany=0;
		this.secteurActiviteCompany="";
	}

        public CompanyInDatabase(String nameCompany, String descriptionCompany,
				String secteurActiviteCompany) {
			super();
			this.nameCompany = nameCompany;
			this.descriptionCompany = descriptionCompany;
			this.secteurActiviteCompany = secteurActiviteCompany;
		}


		@Id 
    	@GeneratedValue(strategy=GenerationType.AUTO)
		public int getIdCompany() {
		return idCompany;
	}
        
        @OneToMany
        public List<ProductInStock> getProducts() {
    		return products;
    	}
        
        public void addProductOrder(ProductInStock product){
            products.add(product);
            product.company = this;
    }


    	public void setProducts(List<ProductInStock> products) {
    		this.products = products;
    	}


	public void setIdCompany(int idCompany) {
		this.idCompany = idCompany;
	}


	public String getNameCompany() {
		return nameCompany;
	}


	public void setNameCompany(String nameCompany) {
		this.nameCompany = nameCompany;
	}


	public String getDescriptionCompany() {
		return descriptionCompany;
	}


	public void setDescriptionCompany(String descriptionCompany) {
		this.descriptionCompany = descriptionCompany;
	}


	public String getSecteurActiviteCompany() {
		return secteurActiviteCompany;
	}


	public void setSecteurActiviteCompany(String secteurActiviteCompany) {
		this.secteurActiviteCompany = secteurActiviteCompany;
	}


        public int getNumberContratsCompany() {
		return numberContratsCompany;
	}


	public void setNumberContratsCompany(int numberContratsCompany) {
		this.numberContratsCompany = numberContratsCompany;
	}


		


       
}